<%@ page import="org.apache.struts.action.Action"%>
<%@ page import="com.mbbmap.util.*" %>
<%@ page import = "java.util.ArrayList" %>
<%@ page import = "com.mbbmap.util.Constants" %>
<%@ page import = "com.mbbmap.security.dao.*" %>

<%
	ArrayList secGroupAccessList = (ArrayList) session.getAttribute(Constants.LOGON_ACCESS_LIST);
	SecUserDao oSecUserDao = (SecUserDao) session.getAttribute(Constants.LOGGED_USER);
	String sUserName = oSecUserDao.getUserName();
	String lastLogonDateTime = (String) session.getAttribute(Constants.LAST_LOGON_DATETIME);

	String selected = "";
	int iSec001 = 0;
	int iSec002 = 0;
	int iSec003 = 0;
	int iSec004 = 0;
	int iSec005 = 0;
	int iSec006 = 0;
	int iSec007 = 0;
	int iSec008 = 0;

	for (int i = 0; i < secGroupAccessList.size(); i++) {
		SecAccessDao secaccessDao = (SecAccessDao) secGroupAccessList.get(i);
		String strModuleCode = secaccessDao.getModuleCode();
		if (strModuleCode.equals("SEC001"))
			iSec001 = 1;
		if (strModuleCode.equals("SEC002"))
			iSec002 = 1;
		if (strModuleCode.equals("SEC003"))
			iSec003 = 1;
		if (strModuleCode.equals("SEC004"))
			iSec004 = 1;
		if (strModuleCode.equals("SEC005"))
			iSec005 = 1;
		if (strModuleCode.equals("SEC006"))
			iSec006 = 1;
		if (strModuleCode.equals("SEC007"))
			iSec007 = 1;
		if (strModuleCode.equals("SEC008"))
			iSec008 = 1;
	}
%>

<link href="resource/style.css" rel="stylesheet" type="text/css">
	
	<script type="text/javascript">
	    window.history.forward();
	    function noBack() { window.history.forward(); }
	</script>
<style type="text/css"></style></head>

<body class="home" onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
	<a name="top"></a>
	
<!-- Header -->
<%@ include file="/jsp/common/Header.jsp" %>	
<!-- End Header -->


	<div id="bgWrapper">
		<div id="container">

			<div id="titleBar">
				<ul class="topBar">
					<li class="goBackBt"><a href="<%=request.getContextPath()%>/CheckUserLogon.do?dispatch=homePage"></a></li>
					<li>
					  <h1>Security Management</h1></li>
				</ul>
			</div>

			<div id="fullcontent">
<!-- Security Navigation -->
<%@ include file="SecurityNavigation.jsp" %>	
<!-- End SecurityNavigation -->

				<div id="contentRightIn">
					<table border="0" cellpadding="0" cellspacing="0" width="650px">
						<tbody>
							<tr>
								<td>
									<div
										style="width: auto; height: auto; padding: 12px 20px; margin: 0 0 5px 0; display: block; font-size: 20px; font-weight: bold; color: #ffb606;">
										What to do:</div>
									<table cellpadding="0" cellspacing="0" border="0">
										<tr>
											<td width="50%">
												<div class="listingBox"
													<%=iSec001 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation1" name="SecurityNavigation1"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain1"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation1').submit()">
															<h3>Groups &amp; Modules Setup</h3> 
															<br /> Allows to add new user groups or new modules the system.
														</a>
													</form>
												</div>
											</td>
											<td width="50%"><div class="listingBox"
													<%=iSec002 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation2" name="SecurityNavigation2"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain2"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation2').submit()">
															<h3>Groups Level Setup</h3> 
															<br /> Add on user group to another to setup the user hierarchy.
														</a>
													</form>
												</div></td>
										</tr>
										<tr>
											<td><div class="listingBox"
													<%=iSec003 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation3" name="SecurityNavigation3"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain3"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation3').submit()">
															<h3>Access Rights Setup</h3> 
															<br /> Assign modules to the user group for access rights setup.
														</a>
													</form>
												</div></td>
											<td><div class="listingBox"
													<%=iSec004 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation4" name="SecurityNavigation4"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain4"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation4').submit()">
															<h3>User Creation</h3> 
															<br /> Create user of the group assigned.
														</a>
													</form>
												</div></td>
										</tr>
										<tr>
											<td><div class="listingBox"
													<%=iSec007 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation7" name="SecurityNavigation7"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain7"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation7').submit()">
															<h3>Parameter Setup</h3> 
															<br /> Configure system parameters.
														</a>
													</form>
												</div></td>
											<td><div class="listingBox"
													<%=iSec006 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation6" name="SecurityNavigation6"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain6"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation6').submit()">
															<h3>Reset User</h3> 
															<br /> Reset a specified user access.<br /> <br />
														</a>
													</form>
												</div></td>
										</tr>
										<tr>
											<td></td>
											<td><div class="listingBox"
													<%=iSec008 == 1 ? "" : "style='display:none'"%>>
													<form id="SecurityNavigation8" name="SecurityNavigation8"
														action="<%=request.getContextPath()%>/ShowSecurityScreen.do?dispatch=secmain8"
														method="post">
														<input type="hidden" name="<%=Constants.TOKEN_KEY%>"
															value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
														<a href="#"
															onclick="document.getElementById('SecurityNavigation8').submit()">
															<h3>Audit Trail</h3> 
															<br /> Inquiry of user audit trail.
														</a>
													</form>
												</div></td>
										</tr>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
<!-- Footer -->
<%@ include file="/jsp/common/Footer.jsp" %>	
<!-- End Footer -->
		</div>
	</div>
